import QtQuick
import QtQuick.Controls
import QtQuick.Controls.Material
import QtQuick.Layouts

Rectangle {
    Layout.fillWidth: true
    Layout.fillHeight: true
    color: "#fafafa"

    Rectangle {
        anchors.centerIn: parent
        width: parent.width * 0.8
        height: parent.height * 0.8
        color: "#ffffff"
        radius: 8

        ScrollView {
            id: scrollView
            anchors.fill: parent
            anchors.margins: 8
            
            TextArea {
                id: materialTextArea
                width: scrollView.width
                height: scrollView.height
                
                // 基本属性
                placeholderText: "请输入文本..."
                placeholderTextColor: "#999999"
                font.pixelSize: 16
                wrapMode: TextArea.Wrap
                
                Rectangle {
                    width: parent.width
                    anchors.bottom: parent.bottom
                    color: parent.activeFocus ? Material.accent : "#e0e0e0"

                    Behavior on color {
                        ColorAnimation { duration: 200 }
                    }
                }
            }
        }
    }
}
